package com.w2cx.selenium.page;

import com.w2cx.selenium.base.DriverBase;
import com.w2cx.selenium.util.Locator;
import org.openqa.selenium.WebElement;

import java.util.List;

public class DestinationManagePage extends BasePage {

    DriverBase driver;
    public DestinationManagePage(DriverBase driver){

        super(driver);
    }


    //获取“基础数据管理”菜单
    public WebElement getBaseDataManageMenu(){
        List<WebElement> list = elements(Locator.getByLocator("firstMenuList"));
        WebElement element = list.get(3);
        System.out.println("找到元素:"+element.getText());
        return element;
    }

    //获取“目的地管理”菜单
    public WebElement getDestinationManageMenu(){
        List<WebElement> list = elements(Locator.getByLocator("BaseDataSecondMenu"));
        WebElement element = list.get(5);
        System.out.println("找到元素:"+element.getText());
        return element;
    }



    //获取“添加”按钮
    public WebElement getDestiAddBtn(){
        WebElement element = element(Locator.getByLocator("addDestiBtn"));
        System.out.println("找到元素:"+element.getText());
        return element;

    }


    //获取目的地名称输入框
    public WebElement getDestiNameInput(){
        WebElement element = element(Locator.getByLocator("destiNameInput"));
        System.out.println("找到元素:"+element.getText());
        return element;
    }


    //获取分类下拉框
    public WebElement getDestiCategory(){
        WebElement element = element(Locator.getByLocator("destiCategory"));
        System.out.println("找到元素:"+element.getText());
        return element;
    }

    //获取选项
    public WebElement getCateSelect(){
        WebElement element = element(Locator.getByLocator("destiCateSelect"));
        System.out.println("找到元素:"+element.getText());
        return element;
    }

    //获取选择按钮
    public WebElement getSelectBtn(){
        List<WebElement> list = elements(Locator.getByLocator("selectBtn"));
        WebElement element = list.get(0);
        return element;
    }

    //获取“北京市”选项
    public WebElement getBJOption(){
        WebElement element = element(Locator.getByLocator("selectBJOption"));
        return element;
    }

    //获取“确定”按钮
    public WebElement getSelectBJConfirmBtn(){
        WebElement element = element(Locator.getByLocator("selectBJConfirmBtn"));
        return element;
    }

    //获取添加缩略图按钮
    public WebElement getAddThumbnailBtn(){
        WebElement element = element(Locator.getByLocator("addThumbnailBtn"));
        return element;
    }



    //获取“确认”按钮
    public WebElement getAddThumbnailConfirmBtn(){
        WebElement element = element(Locator.getByLocator("addDestiConfirmBtn"));
        return element;
    }

    //获取列表中首行“目的地名称”
    public WebElement getFirstDestiName(){
        WebElement element = element(Locator.getByLocator("alreadyAddDestiName"));
        return element;
    }


    //获取查询条件“状态”下拉框
    public WebElement getStatusDownList(){
        WebElement element = element(Locator.getByLocator("statusDownList"));
        return element;
    }

    //获取“正常”选项
    public WebElement getStatusSelect(){
        WebElement element = element(Locator.getByLocator("statusSelect"));
        return element;
    }

    //获取查询条件“分类”下拉框
    public WebElement getCategoryDownList(){
        WebElement element = element(Locator.getByLocator("categoryDownList"));
        return element;
    }

    //获取选项
    public WebElement getCateogrySelect(){
        WebElement element = element(Locator.getByLocator("categorySelect"));
        return element;
    }

    //获取搜索按钮
    public WebElement getSearchBtn(){
        WebElement element = element(Locator.getByLocator("searchBtn"));
        return element;
    }

    //获取搜索结果列表
    public List<WebElement> getSearchResultList(){
        List<WebElement> list = elements(Locator.getByLocator("selectResultList"));
        return list;
    }


}
